package com.itqf.service.impl;

import com.itqf.mapper.DtsGoodsProductMapper;
import com.itqf.service.DtsGoodsProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * projectName: gp_manage
 *
 * @author: 赵伟风
 * time: 2021/8/18 17:34
 * description:
 */
@Service
public class DtsGoodsProductServiceImpl implements DtsGoodsProductService {


    @Autowired
    private DtsGoodsProductMapper dtsGoodsProductMapper;

    /**
     * 货品的数量
     *    查询库存表count,但是要求货品未逻辑删除，商品未逻辑删除，商品上架
     * @return
     */
    @Override
    public Long findProductTotal() {

       Long productTotal =   dtsGoodsProductMapper.selectProductTotal();

       return productTotal;
    }

    /**
     * 获取的数量
     * 根据品牌查询
     *
     * @param brandIds
     * @return
     */
    @Override
    public Long findProductTotal(List<Integer> brandIds) {

        Long productTotal =   dtsGoodsProductMapper.selectProductTotalByBrandIds(brandIds);

        return productTotal;
    }
}
